home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / rocketcar2.swf / scripts / frame_44 / PlaceObject3_1036_294 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2008-09-24  |  1.7 KB  |  97 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.paused)
  3.    {
  4.       return undefined;
  5.    }
  6.    if(timeB)
  7.    {
  8.       time++;
  9.       if(time > 3)
  10.       {
  11.          var b = type + _root.depthHolder;
  12.          _root.depthHolder = _root.depthHolder + 1;
  13.          _root.attachMovie(type,b,random(100000));
  14.          _root[b]._x = _X;
  15.          _root[b]._y = _Y + 50;
  16.          if(c == 1)
  17.          {
  18.             _root[b].type = "slow";
  19.          }
  20.          if(c == 2)
  21.          {
  22.             _root[b].type = "homing";
  23.          }
  24.          time = 0;
  25.          bombs++;
  26.       }
  27.       if(c == 1)
  28.       {
  29.          m = 10;
  30.       }
  31.       if(c == 2)
  32.       {
  33.          m = 15;
  34.       }
  35.       if(bombs > m)
  36.       {
  37.          bombs = 0;
  38.          timeB = false;
  39.          changeDir();
  40.          time = 0;
  41.       }
  42.    }
  43.    if(getTimer() > resetTime)
  44.    {
  45.       changeDir();
  46.       resetTime = getTimer() + delay;
  47.    }
  48.    if(dir == "left")
  49.    {
  50.       _X = _X - speed;
  51.    }
  52.    if(dir == "right")
  53.    {
  54.       _X = _X + speed;
  55.    }
  56.    if(_X > 500)
  57.    {
  58.       dir = "left";
  59.    }
  60.    if(_X < 100)
  61.    {
  62.       dir = "right";
  63.    }
  64.    time++;
  65.    if(time > 200)
  66.    {
  67.       bomb();
  68.       time = 0;
  69.    }
  70.    if(!damage)
  71.    {
  72.       if(this.box.hitTest(_root.car))
  73.       {
  74.          _root.cSound();
  75.          damage = true;
  76.          health -= 20;
  77.          _root.car.ySpeed = (- _root.car.ySpeed) * 0.3;
  78.          _root.gravity("reverse");
  79.       }
  80.    }
  81.    if(damage)
  82.    {
  83.       _alpha = random(100) + 10;
  84.       t++;
  85.       if(t > 20)
  86.       {
  87.          t = 0;
  88.          _alpha = 100;
  89.          damage = false;
  90.       }
  91.    }
  92.    if(_root.car.dead)
  93.    {
  94.       ufoS.stop();
  95.    }
  96. }
  97.